all: so 

so: hidb.h cfg.h
	cat cfg.h hidb.h > libhidb.h
	gcc -O2 -Wall -fPIC -c hidb.c cfg.c -DNDEBUG -I /usr/local/tokyotyrant/include -I /usr/local/tokyocabinet/include
	gcc -shared -Wl,-soname,libhidb.so -o libhidb.so cfg.o hidb.o -L /usr/local/tokyotyrant/lib -ltokyotyrant

test: hidb.h cfg.h
	gcc -o hidb hidb.c cfg.c md5.c -ggdb -Wall -I /usr/local/tokyotyrant/include -I /usr/local/tokyocabinet/include -L /usr/local/tokyotyrant/lib -ltokyotyrant -DHITBL_MAIN

install:
	cp hidb.h	/usr/local/include/
	cp hidb.so	/usr/local/lib/
